/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/




#if !defined(AFX_PGLSOLIDBRUSH_H__4D2F2BA9_DD05_4591_BBAB_F093DB59243E__INCLUDED_)
#define AFX_PGLSOLIDBRUSH_H__4D2F2BA9_DD05_4591_BBAB_F093DB59243E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <pgl/core/PGLColor.h>
#include <pgl/core/PGLBrush.h>

/*! \brief Solid fill brush

  \ingroup PGLBrushGroup
*/
class PGLCORE_EXT_CLASS CPGLSolidBrush : public CPGLBrush  
{
	PGL_DECLARE_DYNCREATE(CPGLSolidBrush);
public:
	//! \name Constructors
	//@{
	//! Default
	CPGLSolidBrush(const CPGLColor& _c = CPGLColor(1,1,1,1))	{m_c = _c;};
	CPGLSolidBrush(const CPGLSolidBrush& brush)	{*this = brush;};
	CPGLSolidBrush& operator = (const CPGLSolidBrush& brush);
	virtual ~CPGLSolidBrush();
	//@}

	//! \name Getters and Setters
	//@{
	CPGLColor& GetColor()									{	return m_c;};
	const CPGLColor& GetColor()	const						{	return m_c;};
	void SetColor(const CPGLColor& col)						{	m_c=col;};
	void SetColor(float r, float g, float b, float a = 1)	{	m_c.SetColor(r,g,b,a);};
	//@}

	virtual void MakeCurrentFill(gfxinterface::CGfxInterface& gfx)	{	gfx.SetFillColor(m_c[0],m_c[1],m_c[2],m_c[3]);	};

	//! Serialize functions
	virtual void SerializeXML(CPGLArchive& ar);

	//! \name Debuggin functions
	//@{
	#ifdef _DEBUG
	    virtual void Dump( CDumpContext& dc ) const;
	    virtual void AssertValid() const;  
	#endif
	//@}
protected:
	//! Color
	CPGLColor m_c;
};

PGL_DECLARE_SMARTPTR( CPGLSolidBrush );

#endif // !defined(AFX_PGLSOLIDBRUSH_H__4D2F2BA9_DD05_4591_BBAB_F093DB59243E__INCLUDED_)
